$(function(){

	$('#page2').hide();
	$('#page3').hide();
$('#nextPage').click(function(){
    var ReId=document.getElementById("ReId").value.trim();
    var ReIdRegex=/\b\d{12}\b/;
    var ReIdRegex2=/\S/;
     if(!ReIdRegex.test(ReId)||!ReIdRegex2.test(ReId)){
        document.getElementById("ReIdInfo").innerHTML="信息未填或不正确";
    }else{
		$('#page1').hide();
		$('#page2').toggle();
		$('#page3').hide();

		$('#pageNum2').css('background','#232526');
        $('#pageNum1').css('background','#5E6265');
         }
   });
$('#nextPage1').click(function(){
    var call=document.getElementById("call").value.trim();
    var callRegex=/^0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8}$/;
    var workName=document.getElementById("workName").value.trim();
    var workNameRegex2= /^[a-zA-Z\u4e00-\u9fa5]+$/;
    if(!callRegex.test(call)||!workNameRegex2.test(workName)){
        document.getElementById("callInfo").innerHTML="信息未填或不正确";
    }else{
		$('#page1').hide();
		$('#page2').hide();
		$('#page3').toggle();

		$('#pageNum1').css('background','#5E6265');
        $('#pageNum2').css('background','#5E6265');
        $('#pageNum3').css('background','#232526');
         }   
	});
$('#nextPage2').click(function(){
    var Slogan=document.getElementById("Slogan").value.trim();
    var SloganRegex= /\S/;
    var call=document.getElementById("call").value.trim();
    var callRegex=/^0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8}$/;
    var workName=document.getElementById("workName").value.trim();
    var workNameRegex2= /^[a-zA-Z\u4e00-\u9fa5]+$/;
    var ReId=document.getElementById("ReId").value.trim();
    var ReIdRegex=/\b\d{12}\b/;
    var ReIdRegex2=/\S/;
    if(!SloganRegex.test(Slogan)||!callRegex.test(call)||!workNameRegex2.test(workName)||!ReIdRegex.test(ReId)||!ReIdRegex2.test(ReId)){
        document.getElementById("SloganInfo").innerHTML="信息未填或不正确";
    }else{
        alert("报名成功！为你跳转首页");
        setTimeout(window.location.href="index.html",300); 
         }
    });			
  })

$(function(){
$('#frontPage1').click(function(){
		$('#page1').toggle();
		$('#page2').hide();
		$('#page3').hide();

		$('#pageNum1').css('background','#232526');
        $('#pageNum2').css('background','#5E6265');
        $('#pageNum3').css('background','#5E6265');
    });
    
      $('#frontPage2').click(function(){
		$('#page1').hide();
		$('#page2').toggle();
		$('#page3').hide();

		$('#pageNum1').css('background','#5E6265');
        $('#pageNum2').css('background','#232526');
        $('#pageNum3').css('background','#5E6265');

      });

      $('#pageNum1').mouseover(function(){
      $('#page1').toggle();
      $('#page2').hide();
	  $('#page3').hide();

      $('#pageNum1').css('background','#232526');
      $('#pageNum2').css('background','#5E6265');
      $('#pageNum3').css('background','#5E6265');
    })
      
      $('#pageNum2').mouseover(function(){
      $('#page1').hide();
      $('#page2').toggle();
	  $('#page3').hide();

      $('#pageNum1').css('background','#5E6265');
      $('#pageNum2').css('background','#232526');
      $('#pageNum3').css('background','#5E6265');
    })

     $('#pageNum3').mouseover(function(){
      $('#page1').hide();
      $('#page2').hide();
	  $('#page3').toggle();

      $('#pageNum1').css('background','#5E6265');
      $('#pageNum2').css('background','#5E6265');
      $('#pageNum3').css('background','#232526');
    })

       var i=1;
     $('#member').click(function(){
         document.getElementById("memberDiv").innerHTML+='<div id="div_'+i+'"><input name="text" name="text_'+i+'" type="text" class="form-control" style="margin:10px 0px;" /><input type="button" value="删除"  onclick="del('+i+')" class="btn btn" /></div>'
         document.getElementById("callDiv").innerHTML+='<div id="div_'+i+'"><input name="text" name="text_'+i+'" type="text" class="form-control" style="margin:10px 0px;" /><input type="button" value="删除"  onclick="del('+i+')" class="btn btn" /></div>'
         i = i + 1;
   })
})
        function del(o){
 document.getElementById("memberDiv").removeChild(document.getElementById("div_"+o));
 document.getElementById("callDiv").removeChild(document.getElementById("div_"+o));
          }

function checkTeamName(){
    var TeamName=document.getElementById("TeamName").value.trim();
    var TeamNameRegex=/^[^@#]{3,16}$/;
    if(!TeamNameRegex.test(TeamName)){
        document.getElementById("nameInfo").innerHTML="队名为3~16个字符且不能含”@”和”#”";
    }else{
        document.getElementById("nameInfo").innerHTML="";
        return true;
	}
}

function checkReId(){
    var ReId=document.getElementById("ReId").value.trim();
    var ReIdRegex=/\b\d{12}\b/;
    var ReIdRegex2=/\S/;
    if(!ReIdRegex.test(ReId)||!ReIdRegex2.test(ReId)){
        document.getElementById("ReIdInfo").innerHTML="不能为空且报名编号必须为12位数字";
    }else{
        document.getElementById("ReIdInfo").innerHTML="";
        return true;
    }
}


function checkCall(){
    var call=document.getElementById("call").value.trim();
    var callRegex=/^0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8}$/;
    if(!callRegex.test(call)){
        document.getElementById("callInfo").innerHTML="不能为空且联系方式为11位手机号码";
    }else{
        document.getElementById("callInfo").innerHTML="";
        return true;
    }

}

function checkWorkName(){
    var workName=document.getElementById("workName").value.trim();
    var workNameRegex2= /^[a-zA-Z\u4e00-\u9fa5]+$/;
    if(!workNameRegex2.test(workName)){
        document.getElementById("workNameInfo").innerHTML="不能为空且是数字或其他符号";      
    }else{
        document.getElementById("workNameInfo").innerHTML="";
        return true;
    }

}
function checkReDc(){
    var ReDc=document.getElementById("ReDc").value.trim();
    var ReDcRegex= /\S/;
    if(!ReDcRegex.test(ReDc)){
        document.getElementById("ReDcInfo").innerHTML="不能为空";
    }else{
        document.getElementById("ReDcInfo").innerHTML="";
        return true;
    }

}
function checkSlogan(){
    var Slogan=document.getElementById("Slogan").value.trim();
    var SloganRegex= /\S/;
    if(!SloganRegex.test(Slogan)){
        document.getElementById("SloganInfo").innerHTML="不能为空";
    }else{
        document.getElementById("SloganInfo").innerHTML="";
        return true;
    }

}